import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

export default new Vuex.Store({
    state:{
        msg:'123',
        newMsg:'',
        list:[]
    },
    mutations:{
        toMsg(state,str){
            state.newMsg = state.msg;
            state.list.push(state.msg);
        },
        clearMsg(state){
            state.msg = '';
        },
        delMsg(state,index){
            state.list.splice(index,1)
        }
    },
    getters:{
        
    }
})